<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html>
<html data-ng-app="myApp">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>

<script type="text/javascript">
 
    var app = angular.module('myApp', []);
    app.controller('MyController', function($scope, $http,$window) {
    	//$window.alert("data");
    	$scope.getProjectDataFromServer = function() {
    		//alert("data");
    		    $http({method: 'GET', url: 'getProjects'}).
		        success(function(data, status, headers, config) {
		        	//JSON.stringify(data);
		        	$scope.ls = data;
		        	//$scope.ls =['a','b','c','d'];
		        	alert("data"+$scope.ls);
		        }).
		        error(function(data, status, headers, config) {
		         alert("error"+status);
		        });		    
		    };		   
	  });
  	
  </script>
</head>
<body data-ng-controller="MyController">

<table style="margin: 0px auto;" align="left">
		<tr>
		
			<td>
				<div data-ng-init="getProjectDataFromServer()">
				<!-- <ul>
				<li data-ng-repeat="x in ls">{{x}}</li></ul> -->
					<b>Project Data:</b> <select id="projectData">
						<option value="">-- Select Project --</option>
						<option data-ng-repeat="projectData in ls" value="{{projectData}}">{{projectData}}</option>
					</select><br>
				</div>
			</td>
		</tr>
	</table>

</body>
</html>